
<?php include_once 'common/header.php';  ?>
<!-- admin_main -->
<div class="admin_main">
	<!-- Admin_top end -->
	<?php include_once 'common/shop_left.php';  ?>
	<!-- Admin_Left End -->
	<div class="admin_right">
		<div class="admin_right_title">
			<strong>商城管理</strong> &gt;&gt;  添加公告
		</div>
		
		<div class="admin_right_info">
			<iframe name="iframe" id="iframe" style="display:none;"></iframe>
			<form action="/ychadmin/shop/notice_set" method="post" id="articleForm" name="articleForm"  enctype="multipart/form-data" target="iframe">
			<input type="hidden" id="id" name="id" value="<?php echo isset($info['id']) ? $info['id']:'';?>" />
			<div class="admin_right_info_title"><h2>添加公告</h2></div>
			<ul>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">标题：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="title" id="title" size="50"  value="<?php echo isset($info['title']) ? $info['title']:'';?>" />
					</div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">作者：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="author" id="author" size="50" value="<?php echo isset($info['author']) ? $info['author']:COMPANY_NAME;?>" />
					</div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">来源：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="fsource" id="fsource" size="50" value="<?php echo isset($info['fsource']) ? $info['fsource']:COMPANY_NAME;?>" />
					</div>
				</li>
				
				<li>
					<div class="admin_right_info_tr admin_right_info_l">发布时间：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="ptime" id="ptime" value="<?php echo isset($info['ptime']) ? date('Y-m-d',$info['ptime']):'';?>" onfocus="WdatePicker()" class="Wdate"/>
					</div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">排序：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="forder" id="forder" value="<?php echo isset($info['forder']) ? $info['forder']:'';?>" />
					</div>
				</li>
				
			</ul>
			<div class="admin_right_info_title" style="margin-top:20px;"><h2></h2></div>
			<ul>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">内容：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.config.js"></script>
    				<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.all.js"></script>
    				<script type="text/javascript" charset="utf-8">
				          var editor = new baidu.editor.ui.Editor();
				          editor.render('content');  //editor为编辑器容器的id
				      </script>
					<textarea name="content" id="content" style="width:800px"><?php echo isset($info['content']) ? $info['content']:'';?></textarea>
					</div>
				</li>
				<li>
					<input type="submit" value="提交" />
				</li>
			</ul>
			</form>
			</div>
	</div>
<!-- Admin_Right End -->
</div>
<!-- admin_main end -->
<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({formID:"articleForm",debug:false,submitOnce:true,
		onError:function(msg,obj,errorlist){
			$("#errorlist").empty();
			$.map(errorlist,function(msg){
				$("#errorlist").append("<li>" + msg + "</li>")
			});
			alert(msg);
		},
		submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...'
	});
	$("#title").formValidator({autoModify:true,onShow:"",onFocus:"标题在1-50个汉字之间",onCorrect:""}).inputValidator({min:1,max:50,onError:"标题不能为空,请确认"});
	$("#content").formValidator({onShow:"",onFocus:"内容不能为空",onCorrect:""}).inputValidator({min:1,onError:"内容不能为空,请确认"});
});
</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
</body>
</html>
